//
//  AmusementViewCell.m
//  XiangMuB
//
//  Created by 999999999999 on 16/8/16.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "AmusementViewCell.h"
#import <UIImageView+WebCache.h>
#import "AmusementModel.h"
@implementation AmusementViewCell

-(void)awakeFromNib {
    //cell的背景图片
    UIImageView *bgView = [[UIImageView alloc]init];
    bgView.image = [UIImage imageNamed:@"mainCellBackground"];
    self.backgroundView = bgView;
}
-(void)setFrame:(CGRect)frame {
    frame.origin.x = 10;
    frame.size.width -= 2*frame.origin.x;
    frame.size.height -= 8;
    frame.origin.y += 10;
    [super setFrame:frame];
}

-(void)setModel:(AmusementModel *)model {
    
    if (_model != model) {
        _model= model;
        self.title.text = model.ltitle;
        [self.iconImage sd_setImageWithURL:[NSURL URLWithString:model.imgsrc]];
        self.source.text = model.source;
        self.votecount.text = [NSString stringWithFormat:@"%ld",(long)model.votecount];
    }
}
@end
